package com.sdy.hospitalguard.biz.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sdy.common.model.BizException;
import com.sdy.hospitalguard.biz.dto.VisitAppointmentDTO;
import com.sdy.hospitalguard.biz.dto.VisitDTO;
import com.sdy.hospitalguard.biz.dto.VisitManageDTO;
import com.sdy.hospitalguard.biz.model.VisitAppointment;
import com.sdy.mvc.service.BaseService;

import java.util.List;

/**
 * <p>
 * 探视预约表 服务类
 * </p>
 *
 * @author zzq
 * @since 2020-05-08
 */
public interface VisitAppointmentService extends BaseService<VisitAppointment> {

    List<VisitAppointmentDTO> patientTodayVisit(Integer patientId);

    IPage<VisitAppointmentDTO> patientAllVisit(Page page, Integer patientId);

    /**
     * 提交探视申请
     *
     * @param visitDTO
     * @throws BizException
     */
    void saveVisit(VisitDTO visitDTO) throws BizException;

    boolean compareTime(String first, String second);

    String hmsAdd(String currentDay, String start, Integer interval);

    /**
     * 获取即将预约的时间范围内存在冲突的探视记录
     *
     * @return
     */
    List<VisitAppointment> getVisitAppointment(Integer patientId, String dayStartTime, String dayEndTime);

    /**
     * 探视时间获取
     *
     * @param patientId
     * @return
     */
    JSONObject selectTimeLimit(Integer patientId) throws BizException;

    IPage<VisitManageDTO> getVisitInformation(Page page, String message, Integer areaId, String start, String end, Integer userAreaId);

    List<VisitManageDTO> getVisitInformationList(String message, Integer areaId, String start, String end, Integer userAreaId);

}
